<div class="page-header">
    <h3><?php echo lang('events'); ?></h3>
</div>

<?php
if(!isset($events)):
echo '<p>'.lang('no_events').'</p>';
else:
?>

<table class="table table-condensed">
    <thead>
        <tr>
            <th><?php echo lang('publish_date'); ?></th>
            <th><?php echo lang('last_update'); ?></th>
            <th><?php echo lang('title'); ?></th>
            <th><?php echo lang('author'); ?></th>
        </tr>
    </thead>
    <tbody class="well">
        <?php
        foreach($events as $event):
        ?>
        <tr>
            <td><?php echo $event['publish_date'].' '.$event['publish_time']; ?></td>
            <td><?php echo $event['updated'] ? $event['last_update_date'].' '.$event['last_update_time'] : ''; ?></td>
            <td><?php echo anchor('events/view/'.$event['id'], $event['title']); ?></td>
            <td><?php echo anchor('user_profiles/view/'.$event['author_id'], (($event['author_id'] === $user_id) ? lang('me') : $event['author'])); ?></td>
        </tr>
        <?php
        endforeach;
        ?>
    </tbody>
</table>

<?php
endif;